Description of routines for vertical scrolling areas (VSA) in CV3.

Predetermined aspects for Vertical scrolling Areas (VSA) are loaded up at ram value $2A when loaded with #04 and are 
active when $2A is loaded with #05.

-----------------------------------------------------------------------------------------------


The routine for $2A #05 begins at 0x:3F5CE, with a JSR $5DF5.

20 5D F5- Not Distinct. Likely some kind of initiation routine for scrolling areas.
20 0B 8F- Not distinct.
20 21 8A- Not distinct.
AD 65 05- $656 Loads a certain value depending on what manner the player is moved on the screen.
05 BF-    ORA $BF, if #81, player is dying, if #82, player is dead.
30 2E-    Branch on minus (BMI)
20 0B CB- Distinct. A command for Scrolling.
20 70 85- Distinct. (0x:38580) Contains code that loads values into ram locations based on what the player does.
20 9D AF- Not distinct.
20 E3 FD- Not distinct.
20 62 82- Distinct.
20 D6 9E- Distinct.
20 0C 80- Not Distinct. However, only 4 of these exist in the rom, and typically appear at the end of a routine.
60-       Primary RTS. Passed this is the branched code used under the BMI condition from earlier.
A9 02-    LDA #02
85 1C-    STA $1C
20 A0 E7- Only two of these exist. If deleted (e.g., replaced by NOPs) then game will freeze upon entering a VSA.
20 5F F7- Again, only two of these.
20 E3 E8- Distinct.
A9 01-    LDA #01
85 2A-    STA $2A. If #01 is stored at $2A, then it means the screen is going through a change.

80= 00
84= 
88= 
8C= 
90= 
94= 
98= 
9C= 38

----------------------------------------------------------------------------------------------

20 0B CB: The whole big fat scrolling routine!

It begins with a JSR to 0x3CA4E...

----------------------------------------------------------------------------------------------

20 3E CA: First part of the 20 0B CB routine

20 5A C9: JSR
A5 56   : $56
85 08   : whatever
A4 65   : I forget, but its either 00 or 01
F0 49   : BEQ













----------------------------------------------------------------------------------------------

20 3E CA: (See above)
90 0A   : 
20 05 c9: 
A4 65   : 
B9 59 00: 
10 01   : 
60      : 
--
98 0A AA: TYA, ASL, TAX
B5 52   : some pointer temporary storage routine code piece
85 10   : ""
B5 53   : ""
85 11   : ""
A2 FF   :
A4 65   :
B9 5B 00: 
29 01   : 
D0 08   : 
B9 5B 00:
29 FE   : 
0A 0A AA:
86 04   : 
B9 5B 00: 
29 03   :
0A 0A   :
85 12   : 
A6 1D   : 
B9 5B 00:
29 03   : 
C9 01   : 
D0 04   : 
A9 07   : 
D0 02   : 
A9 06   : 
9D 00 03: 
85 06   : 
E8 A9 00: INX, LDA #00
85 61   : 
A4 65   : 
B9 59 00: 
29 07   : 
4A 66 61: LSR, ROR $61
18 69 28: CLC, add #28 to A
9D 01 03: Store to page $300
B9 5B 00: "same, but with $5B"
29 03   : 
0A 0A 0A: 3 ASL
0A 0A   : 2 more ASL
18 65 61: 
9D 00 03: Store to page $300
E8 E8   : 2 INX
86 1D   : 
A5 06   : 
C9 07   : 
D0 13   : 
B9 59 00: 
29 07   : 
A8      : TAY
B9 5C CD: 
9D 20 03: Store to page $300
A9 2B   : LDA #2B
9D 21 03: Store 2B to page $300
86 07   : 

Following this, some 8 repeating turkeynits. Then:

A5 06   :
C9 06   : F0 07
A5 1D   : 
18 69 0A: CLC, add 0A to A
85 1D   : 
60      : RTS
--



----------------------------------------------------------------------------------------------

20 70 85:

A5 68-   LDA $68
C9 82-   CMP #82. If $68 stored with #82, then screen auto-scrolls.
B0 01-   BCS
60-      RTS. Beyond this only concerns areas that auto-scroll...


----------------------------------------------------------------------------------------------

Objectively, $59 and $5A need to be balanced. They constantly decrease as the player goes up and down.



----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

In other news, 0x3870C holds an important check that causes the screen to scroll upward.
This needs to be thoroughly documented

